package com.protocolterminal.DataField;

import java.util.List;

import com.protocolterminal.AFN.AFN0Dwater;
import com.protocolterminal.AFN.BaseAFN;

/**
 * @ClassName: GetDataField_water
 * @Description: 水表集中器
 * @author baozhijian
 * @date 2017年10月20日 上午11:39:13
 * @version V1.0
 */
public class GetDataField_water extends GetDataField_3761 {

	@Override
	public String Encode(String AFN, String SEQ, List<String> DA, List<String> DT, List<String> Data, String AUX) {

		if (AFN.equalsIgnoreCase("0D")) {
			// 水表日冻结
			BaseAFN baseAFN = new AFN0Dwater(AFN, SEQ, DA, DT, Data, AUX);
			String datafield = baseAFN.toString();

			return datafield;

		}

		return super.Encode(AFN, SEQ, DA, DT, Data, AUX);
	}

	@Override
	public BaseAFN Decode(String datafield) {
		if (datafield.substring(0, 2).equalsIgnoreCase("0D")) {
			// 水表日冻结
			return new AFN0Dwater(datafield);
		}
		return super.Decode(datafield);
	}

}
